//
//  NYMeCell.m
//  BS
//
//  Created by neal on 15/8/19.
//  Copyright (c) 2015年 Neal. All rights reserved.
//

#import "NYMeCell.h"

@implementation NYMeCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
        self.backgroundView =[[UIImageView alloc]initWithImage: [UIImage stretchableImageWithImageName:@"mainCellBackground"]];
    }
    return self;
}
- (void)layoutSubviews
{
    [super layoutSubviews];
    
    if (self.imageView.image == nil) {
        return;
    }
    /**
     *  设置 imageview 位置
     */
    CGFloat imageWH = self.contentView.height - Margin * 2;
    self.imageView.width = imageWH;
    self.imageView.height = imageWH;
    self.imageView.centerY = self.contentView.height * 0.5;
    
    self.textLabel.x = CGRectGetMaxX(self.imageView.frame) + Margin;
    
}
@end
